package com.hb.trans.mvp.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.ctcnit.templatepro.global.MyGlideModule
import com.hb.trans.R
import com.hb.trans.bean.Coach
import javax.inject.Inject

class CoachAdapter(layoutResId: Int) : BaseQuickAdapter<Coach, BaseViewHolder>(layoutResId) {
    @Inject
    constructor() : this(R.layout.item_teacher)

//    var teacherHead: ImageView? = null
//    var teacherName: TextView? = null
//    var viewHolder:BaseViewHolder? = null

    override fun convert(holder: BaseViewHolder, item: Coach) {
//        viewHolder = holder
//        teacherHead = holder.getView(R.id.teacher_head)
//        teacherName = holder.getView(R.id.teacher_name)
        item.let {

            var s = it.photourl
            if (s != "") {
                MyGlideModule.load(mContext, it.photourl, holder.getView(R.id.teacher_head))

            }
            holder.setText(R.id.teacher_name, it.name).setText(R.id.teacher_type, it.teachpermitted)
        }
    }


}